$(document).ready(function() {

    $("#nav_admin").addClass("menu_actif");
	
    $(".colorbox").colorbox({
        width:"600px", 
        height:"500px"
    });
	
    $("#recherche_compte").autocomplete("../commun_shop/modules/recherche_compte.php",
    {
        minChars: 2,
        width: 200,
        matchContains: true,
        highlightItem: false,
        formatItem: function(data, i, n, value)
        {
            return value.split("#")[0]+"<br/>"+value.split("#")[1];
        },
        formatResult: function(data, value)
        {
            return value.split("#")[0];
        }
    });
	
    $('#bouton_achat input').bind('click',function(event)
    {	
        $('#bouton_achat a').attr('href', function()
        {
            return '../commun_shop/modules/demande_confirmation_gestion_brousoufs.php?somme='+$('#somme_credit').val()+'&id_consommateur='+$('#recherche_compte').val()+'&op='+$("input[@name='type_operation']:checked").val();        
        })
    });
	
	
    $(document).bind('keydown', 'return',function (event)
    {

        $("#bouton_achat #bouton").click();
        return false;
    }
    );
})